package org.springblade.modules.repair.vo.sign;

import cn.hutool.core.util.RandomUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * 用户考勤通用model
 *
 * @author zcc
 * @version 1.0
 * @date 2022/8/15 9:44
 */
@Data
public class UserSignCommonVo implements Comparable<UserSignCommonVo> {

	private Long id = RandomUtil.randomLong();

	private String userName;

	private Long userId;

	private String msg;

	private String deptName;

	private Long deptId;

	private Integer minuteOrHours;

	private String signTypeName;

	private String date;

	private Boolean isNode;

	@ApiModelProperty("出勤率")
	private BigDecimal workRate;

	private List list;

	@ApiModelProperty("用户数量，排序使用")
	private Integer userCoutns = 0;

	@ApiModelProperty("树形等级1:表示第一级，2：表示第二级")
	private Integer floor;


	@ApiModelProperty("参与考勤人员用户名称")
	private List<String> planUserNames;

	@ApiModelProperty("实际出勤人员名称")
	private List<String> workUserNames;


	@Override
	public int compareTo(UserSignCommonVo o) {
		if (o.getWorkRate() == null) {
			return o.getUserCoutns().compareTo(this.getUserCoutns());
		} else {
			return o.getWorkRate().compareTo(this.getWorkRate());
		}

	}


}
